package com.example.lvsuo.mapper.cxg;

import com.example.lvsuo.entity.cxg.FlowNode;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.lvsuo.entity.cxg.vo.FlowNodeVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 心心念念
 * @since 2021-03-30
 *
 * 流程审批人 Mapper
 *
 */
public interface FlowNodeMapper extends BaseMapper<FlowNode> {

    /**
     * 查询流程审批人
     * @return
     */

    List<FlowNodeVo> queryFlowNode(FlowNodeVo flowNodeVo);

    /**
     * 添加流程审批人
     * @param flowNode
     * @return
     */
    @Insert( " insert into flow_node values(null,null,#{nodeName},#{roleId}) " )
    void addFlowNode(FlowNode flowNode);

    @Delete(" delete from flow_node where id = #{value} ")
    void delFlowNode(String id);

    @Update(" update flow_node set node_name=#{nodeName},role_id=#{roleId} where id = #{id}  ")
    void updateFlowNode(FlowNode flowNode);

    @Select(" select * from flow_node where id = #{id} ")
    FlowNode queryByid(FlowNode flowNode);
}
